home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 426-450 / disk_437 / patchcompiler / instructions < prev    next >
Text File  |  1992-05-06  |  7KB  |  187 lines

  1.  
  2.  
  3.  
  4.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  5.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  6.   ­­                                                                   ­­
  7.   ­­                       PatchStarCompiler V1.00                     ­­
  8.   ­­                                                                   ­­
  9.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  10.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  11.   ­­                                                                   ­­
  12.   ­­      Copyright 1990      Roger Fischlin                           ­­
  13.   ­­                          Steigerwaldweg 6                         ­­
  14.   ­­                          D-6450 Hanau 7                           ­­
  15.   ­­                          Germany                                  ­­
  16.   ­­                                                                   ­­
  17.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  18.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  19.   ­­                                                                   ­­
  20.   ­­  This program is FREEWARE. It's still copyrighted by the author.  ­­
  21.   ­­                                                                   ­­
  22.   ­­                                                                   ­­
  23.   ­­  This program can be freely distributed if :                      ­­
  24.   ­­  1. the name of  the author  and  the  copyright  remark  remain  ­­
  25.   ­­     unchanged.                                                    ­­
  26.   ­­  2. you don't gain any profit by distributing it !                ­­
  27.   ­­                                                                   ­­
  28.   ­­                                                                   ­­
  29.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  30.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.   To Patch, that means manipulating some bytes of a file, has become very
  39.   popular today. Usually you need a file editor like "NewZap" or "File-
  40.   master" to patch. That is why the idea of a simple, PASCAL-like language
  41.   rose. These programs may then be compiled by PatchStarCompiler to from
  42.   CLI executable programs . 
  43.  
  44.  
  45.  
  46.  
  47.                            PatchStar-language
  48.                            ­­­­­­­­­­­­­­­­­­
  49.  
  50.   This language has just some commands:
  51.  
  52.   TEXT, PATCH, CHECK, IF TRUE, IF FALSE, BEGIN, END, EXIT
  53.  
  54.   Usually the  Compiler does not distinguish capital and small letters.
  55.   You can also use as much tabs and spaces as you want. If you type "*"
  56.   or ";" the following line will be a comment line. If you add ";" at
  57.   the end of a line you can write a comment for the source code behind. 
  58.  
  59.  
  60.  
  61.   TEXT     : TEXT is similar to the PASCAL-command  "WriteLn". The
  62.              following text in quotation marks will be written to CLI.
  63.              
  64.              Examples  :   TEXT "Program patched."
  65.                            TEXT 'Wrong version !'
  66.  
  67.  
  68.   PATCH    : PATCH ist the command for patching. After that word you
  69.              have to type the adress (using decimal, hexadecimal [$],
  70.              binary [%] or octal [@] values) . Then you have to leave
  71.              at least one space before writing the bytes that shall be
  72.              patched. You can type ":" after the adress, too.
  73.              If you want to patch a string, you have to use quotation
  74.              marks !  You cannnot mix strings and bytes !
  75.              As PATCH is the most important command you can leave it
  76.              out and immediately start with the adress.
  77.             
  78.  
  79.              Examples  :   PATCH $0000  :  "256"
  80.                            PATCH 50        ff ff ff ea
  81.                            PATCH %110      '200'
  82.                                  123456    $4a $99 $5a
  83.                                  @00       $349afb
  84.  
  85.  
  86.   CHECK    : CHECKs the bytes of the file that will be patched. It may
  87.              of a big advantage if the patch works with some versions of
  88.              the same program. It can also protect you of a wrong patched
  89.              file if you get the version number first.
  90.              It has the same syntax as PATCH but you must not leave it
  91.              out. The results of CHECK can then be worked out with the
  92.              IF commands.
  93.  
  94.              Examples  :   CHECK $0000  :  "256"
  95.                            CHECK 50        ff ff ff ea
  96.                            CHECK %110      '200'
  97.  
  98.  
  99.   BEGIN    : Use BEGIN and END to mark some lines belonging together.
  100.   END        It is necassary in use with the IF commands, so that the
  101.              compiler knows which commands it shall execute and which
  102.              it shall not.
  103.  
  104.  
  105.  
  106.   IF FALSE : Both IF commands work out the results of the CHECK command.
  107.   IF TRUE    The following commands after "IF FALSE" will be executed, if
  108.              the result of CHECK is negative (false). 
  109.              The commands after "IF TRUE" will be executed, if the result
  110.              of CHECK is positive (true). These commands, even when it is
  111.              just one, have to be enclosed by BEGIN and END.
  112.              The IF command just refers to the last executed CHECK command.
  113.              There may be other IF commands in the following block.
  114.  
  115.              Examples  :   CHECK $132  :  "256"
  116.                            IF TRUE
  117.                               BEGIN
  118.                                    TEXT "PAL version !"
  119.                               END
  120.                            IF FALSE
  121.                               BEGIN
  122.                                    PATCH $132 : "256"
  123.                                    TEXT "patched NTS- to PAL version !"
  124.                               END
  125.  
  126.  
  127.  
  128.  
  129.   EXIT     : EXIT ends the patch process immediately.
  130.  
  131.              Examples  :   CHECK $4656  :  "1.3"
  132.                            IF FALSE
  133.                               BEGIN
  134.                                    TEXT "Sorry - wrong version !"
  135.                                    EXIT
  136.                               END
  137.  
  138.  
  139.  
  140.  
  141.                                 Example           
  142.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  143.  
  144.   ; ED Patch      taken from FileMaster
  145.  
  146.  
  147.   check $1aad : "199"                 ; check if it's the right version !
  148.  
  149.  
  150.   if true                                    ; yes, now patch window size
  151.      begin
  152.           Patch $1aad : "255"
  153.           Text  "ED 1.4 will now open PAL window."
  154.      end
  155.  
  156.  
  157.  
  158.   if false                         ; no, it's a different version of ED !
  159.      begin
  160.           Text "Sorry, wrong version of ED !"
  161.      end
  162.  
  163.  
  164.   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.                           how to make a patch
  172.                          ­­­­­­­­­­­­­­­­­­­­­
  173.  
  174.   Write the source code by using any ASCII editor (e.g. ED) and the
  175.   described language. Save it to disk and create another file containing
  176.   in the info text. Compile both files :
  177.  
  178.   1> PatchStarCompiler <info file> <source code> <name of the patch>
  179.  
  180.  
  181.   The compiler then creates step by step the patch and saves it to
  182.   the third parameter.
  183.  
  184.  
  185.  
  186.                                         27. October 1990   Roger Fischlin  
  187.